import Vue from 'vue'
import Router from 'vue-router'
import login from '@/components/login'
import theLaw from '@/components/theLaw'

Vue.use(Router)

export default new Router({
    routes: [
        {
            path: '/',
            name: 'login',
            meta: {
                title: '登陆'
            },
            component: login
        },
        {
            path: '/theLaw',
            name: 'theLaw',
            meta: {
                title: '法律声明'
            },
            component: theLaw
        },
        {
            path: '/common/password',
            name: 'password',
            component: resolve => require(['../components/common/password.vue'], resolve),
        },
        {
            path: '/common/registered',
            name: 'registered',
            component: resolve => require(['../components/common/registered.vue'], resolve),
        },
        // 考生端
        {
            path: '/students/index',
            component: resolve => require(['../components/students/index.vue'], resolve),
            children:[
                {
                    path:'/',
                    component: resolve => require(['../components/students/info.vue'], resolve)
                },
                {
                    path:'/students/online',
                    component: resolve => require(['../components/students/online.vue'], resolve)
                },
                {
                    path:'/students/myTest',
                    component: resolve => require(['../components/students/myTest.vue'], resolve)
                },
                {
                    path:'/students/detail',
                    component: resolve => require(['../components/students/childer/detail.vue'], resolve)
                },
                {
                    path:'/students/pay',
                    component: resolve => require(['../components/students/childer/pay.vue'], resolve)
                },
                {
                    path:'/students/notice',
                    component: resolve => require(['../components/students/childer/notice.vue'], resolve)
                },
                {
                    path:'/students/toSignUp',
                    component: resolve => require(['../components/students/childer/toSignUp.vue'], resolve)
                },
                {
                    path:'/students/download',
                    component: resolve => require(['../components/students/childer/download.vue'], resolve)
                }
            ]
        },
        // 机构端
        {
            path: '/institutions/index',
            component: resolve => require(['../components/institutions/index.vue'], resolve),
            children:[
                {
                    path:'/',
                    component: resolve => require(['../components/institutions/childer/info.vue'], resolve)
                },
                {
                    path:'/institutions/management',
                    component: resolve => require(['../components/institutions/childer/management.vue'], resolve)
                }
            ]
        }
    ]
})
